package com.hliushi.bookmanager.mapper;

import com.hliushi.bookmanager.pojo.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface BookMapper {

    List<Book> getAllBook();

    Book getBookById(String id);

    void updateBook(Book book);

    void deleteBook(long id);

    void addBook(Book book);

    List<Book> searchBook(String keyword);

    void borrowBook(@Param("serNum") String serNum, @Param("bookId") String bookId,
                    @Param("readerId") String readerId, @Param("lendDate") String lendDate);

    void updateBookState(@Param("bookId") String bookId, @Param("state") int state);

    void backBook(@Param("bookId") String bookId, @Param("backTime") String backTime);
}
